<?php

class reporte_model extends CI_Model {

    private $claveuv = "30MSU0940B";
    public $programa = "AMBI-10-E-CR";
    public $distrito = "1";

    function __construct() {
        parent :: __construct();
    }

    function opcionesdecarreras() {
        $dbres = $this->db->get('GENERAL');
        $ddmenu = array();
        foreach ($dbres->result_array() as $tablerow) {
            $ddmenu[$tablerow['PROGRAMA'].'/'.$tablerow['DIST'] ] =  $tablerow['DIST'] . ' - '. $tablerow['DCARRERA'] . ' - '. $tablerow['MODALIDAD'] . ' - '. $tablerow['NIV'];
        }
        return $ddmenu;
    }

    function get_generales() {
        //$this->db->where('PROGRAMA', $this->programa);
        $this->db->where('PROGRAMA', $this->programa);
        $this->db->where('DIST', $this->distrito);
        return $this->db->get('GENERAL')->row_array();
    }

    function get_egreso() {
        //$this->db->where('PROGRAMA', $this->programa);
        $this->db->where('PROGRAMA', $this->programa);
        $this->db->where('DIST', $this->distrito);
        return $this->db->get('EGRESO')->row_array();
    }

    function get_ingreso() {
        //$this->db->where('PROGRAMA', $this->programa);
        $this->db->where('PROGRAMA', $this->programa);
        $this->db->where('DIST', $this->distrito);
        return $this->db->get('INGRESO')->row_array();
    }

    function get_titulados() {
        //$this->db->where('PROGRAMA', $this->programa);
        $this->db->where('PROGRAMA', $this->programa);
        $this->db->where('DIST', $this->distrito);
        return $this->db->get('TITULADOS')->row_array();
    }

    function get_permanencia() {
        //$this->db->where('PROGRAMA', $this->programa);
        $this->db->where('PROGRAMA', $this->programa);
        $this->db->where('DIST', $this->distrito);
        return $this->db->get('PERMANENCIA')->row_array();
    }

    function get_reingreso() {
        //$this->db->where('PROGRAMA', $this->programa);
        $this->db->where('PROGRAMA', $this->programa);
        $this->db->where('DIST', $this->distrito);
        return $this->db->get('REINGRESO')->row_array();
    }

    function generatodo() {
        $this->hoja1();
        $this->hoja2();
        $this->hoja3();
        $this->hoja4();
        $this->hoja5();
        $this->hoja6();
        $this->hoja7();
        $this->hoja8();
        $this->hoja9();
        $this->hoja10();
        /*$this->hoja11();
        $this->hoja12();
        $this->hoja13();*/
    }
    
    function hoja1() {
        extract($this->get_generales());

        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest', array('pagina' => sprintf("%02d", 1)), true);
        $this->mpdf->WriteHTML($vista);

        $s = $this->claveuv;
        $this->mpdf->WriteText(83, 57, expandeespacios($s));
        $uv = "UNIVERSIDAD VERACRUZANA";
        $this->mpdf->WriteText(92, 67, ($uv));
        $claveescuela = $FACU;
        $this->mpdf->WriteText(82.5, 76.5, expandeespacios($claveescuela));
        $facultad = trim($DFACULTAD);
        $this->mpdf->WriteText(50, 86.9, ($facultad));
        $clavecarrera = $CARR;
        $this->mpdf->WriteText(82.5, 99.5, expandeespacios($clavecarrera));
        $carrera = trim($DCARRERA) . " - $MODALIDAD - $CAMPUS";
        $this->mpdf->WriteText(28, 109.8, ($carrera));
        $clavecarrera2 = $CARR2;
        $this->mpdf->WriteText(184, 99.5, expandeespacios($clavecarrera2));
        if ($MODALIDAD == 'ESCOLARIZADO') {
            $escolar = "X";
            $this->mpdf->WriteText(41, 123.5, expandeespacios($escolar));
        } else {
            $semiescolar = "X";
            $this->mpdf->WriteText(247, 123.5, expandeespacios($semiescolar));
        }
    }

    function hoja2() {
        extract($this->get_generales());
        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest', array('pagina' => sprintf("%02d", 2)), true);
        $this->mpdf->WriteHTML($vista);
        if ($NIV == 'TC'||$NIV == 'TS'||$NIV == 'TE') {
            $tecnico = "X";
            $this->mpdf->WriteText(161, 43.5, expandeespacios($tecnico));
        }
        if ($NIV == 'LC'||$NIV == 'LI') {
            $lic = "X";
            $this->mpdf->WriteText(241.5, 44, expandeespacios($lic));
        }
        $aniocreacion = substr($FE_INI_P, 0, -4);
        $this->mpdf->WriteText(133.5, 81.5, expandeespacios($aniocreacion));
        $mescreacion = substr($FE_INI_P, 4, -2);
        $this->mpdf->WriteText(192, 81.5, expandeespacios($mescreacion));
        $diacreacion = substr($FE_INI_P, 6);
        $this->mpdf->WriteText(239, 81.5, expandeespacios($diacreacion));
        $creditos = ajustaa($CRED, 4);
        $this->mpdf->WriteText(162, 180, expandeespacios($creditos));
        $duracion = ajustaa($DUR, 2);
        $this->mpdf->WriteText(133, 125.7, expandeespacios($duracion));
        
        if ($EST == 'S') {
            $semestres = "X";
            $this->mpdf->WriteText(175.5, 132.5, expandeespacios($semestres));
        }
        if ($EST == 'C') {
            $cuatrimestres = "X";
            $this->mpdf->WriteText(198, 132.5, expandeespacios($cuatrimestres));
        }
        
    }

    function hoja3() {
        extract($this->get_generales());
        
        
        extract($this->get_titulados());
        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest', array('pagina' => sprintf("%02d", 3)), true);
        $this->mpdf->WriteHTML($vista);
        
        $periodos = $NP;
        $this->mpdf->WriteText(136, 59, expandeespacios($periodos));
        $anioperiodo1 = "2010";
        $this->mpdf->WriteText(141.5, 79.5, expandeespacios($anioperiodo1));
        $mesperiodo1 = "08";
        $this->mpdf->WriteText(169, 79.5,  expandeespacios($mesperiodo1));
        /*$anioperiodo2 = "2010";
        $this->mpdf->WriteText(141.5, 85.5,  expandeespacios($anioperiodo2));
        $mesperiodo2 = "08";
        $this->mpdf->WriteText(169, 85.5,  expandeespacios($mesperiodo2));*/
        extract($this->get_ingreso());
        $hombres = ajustaa($NIH, 4);
        $this->mpdf->WriteText(184.5, 79.5, expandeespacios($hombres));
        $mujeres = ajustaa($NIM, 4);
        $this->mpdf->WriteText(210.5, 79.5, expandeespacios($mujeres));
        $total = ajustaa($TNI1, 4);
        $this->mpdf->WriteText(237.5, 79.5, expandeespacios($total));
        /*$hombres2 = ajustaa($NHP2, 4);
        $this->mpdf->WriteText(184.5, 85.5, expandeespacios($hombres2));
        $mujeres2 = ajustaa($NMP2, 4);
        $this->mpdf->WriteText(210.5, 85.5, expandeespacios($mujeres2));
        $total2 = ajustaa($TNI2, 4);
        $this->mpdf->WriteText(237.5, 85.5, expandeespacios($total2));*/
        extract($this->get_egreso());
        $egrehombres = ajustaa($TEGH, 4);
        $this->mpdf->WriteText(139, 135, expandeespacios($egrehombres));
        $egremujeres = ajustaa($TEGM, 4);
        $this->mpdf->WriteText(168.7, 135, expandeespacios($egremujeres));
        $egretotal = ajustaa($TEGT, 4);
        $this->mpdf->WriteText(203.8, 135, expandeespacios($egretotal));
        $egrecondiscapacidad = ajustaa($TEG_DIS, 3);
        $this->mpdf->WriteText(239.5, 135, expandeespacios($egrecondiscapacidad));
        
        extract($this->get_titulados());
        $tituladoshombres = ajustaa($TTIH, 4);
        $this->mpdf->WriteText(139, 164.5, expandeespacios($tituladoshombres));
        $tituladosmujeres = ajustaa($TTIM, 4);
        $this->mpdf->WriteText(168.7, 164.5, expandeespacios($tituladosmujeres));
        $tituladostotal = ajustaa($TTIT, 4);
        $this->mpdf->WriteText(203.8, 164.5, expandeespacios($tituladostotal));
        $titcondiscapacidad = ajustaa($TTI_DIS, 3);
        $this->mpdf->WriteText(239.5, 164.5, expandeespacios($titcondiscapacidad));
    }

    function hoja4() {
        extract($this->get_generales());             
        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest', array('pagina' => sprintf("%02d", 4)), true);
        $this->mpdf->WriteHTML($vista);
        
        //$MENOS19=$DUR+$DUR+$DUR;
        /*$PRUEBAS = ajustaa($DUR, 4);
        $this->mpdf->WriteText(20.5, 20.5, expandeespacios($PRUEBAS));*/
        $r = ($this->get_egreso());
        $UNO=$r['EHM18']+$r['EH18']+$r['EH19'];
        $this->mpdf->WriteText(51.5, 59, expandeespacios(ajustaa($UNO, 5)));
        $UNO=$r['EH20']+$r['EH21']+$r['EH22']+$r['EH23']+$r['EH24'];
        $this->mpdf->WriteText(51.5, 65, expandeespacios(ajustaa($UNO, 5)));
        $UNO=$r['EH25']+$r['EH26']+$r['EH27']+$r['EH28']+$r['EH29'];
        $this->mpdf->WriteText(51.5, 71, expandeespacios(ajustaa($UNO, 5)));
        $UNO=$r['EH3034']+$r['EH3539']+$r['EHM39'];
        $this->mpdf->WriteText(51.5, 77.5, expandeespacios(ajustaa($UNO, 5)));        
        $this->mpdf->WriteText(51.5, 86, expandeespacios(ajustaa($r['TEGH'], 5)));
        
        $UNO=$r['EMM18']+$r['EM18']+$r['EM19'];
        $this->mpdf->WriteText(85.5, 59, expandeespacios(ajustaa($UNO, 5)));
        $UNO=$r['EM20']+$r['EM21']+$r['EM22']+$r['EM23']+$r['EM24'];
        $this->mpdf->WriteText(85.5, 65, expandeespacios(ajustaa($UNO, 5)));
        $UNO=$r['EM25']+$r['EM26']+$r['EM27']+$r['EM28']+$r['EM29'];
        $this->mpdf->WriteText(85.5, 71, expandeespacios(ajustaa($UNO, 5)));
        $UNO=$r['EM3034']+$r['EM3539']+$r['EMM39'];
        $this->mpdf->WriteText(85.5, 77.5, expandeespacios(ajustaa($UNO, 5)));
        $this->mpdf->WriteText(85.5, 86, expandeespacios(ajustaa($r['TEGM'], 5)));
        
        $UNO=$r['TEM18']+$r['TE18']+$r['TE19'];
        $this->mpdf->WriteText(117.5, 59, expandeespacios(ajustaa($UNO, 5)));
        $UNO=$r['TE20']+$r['TE21']+$r['TE22']+$r['TE23']+$r['TE24'];
        $this->mpdf->WriteText(117.5, 65, expandeespacios(ajustaa($UNO, 5)));
        $UNO=$r['TE25']+$r['TE26']+$r['TE27']+$r['TE28']+$r['TE29'];
        $this->mpdf->WriteText(117.5, 71, expandeespacios(ajustaa($UNO, 5)));
        $UNO=$r['TE3034']+$r['TE3539']+$r['TEM39'];
        $this->mpdf->WriteText(117.5, 77.5, expandeespacios(ajustaa($UNO, 5)));
        $this->mpdf->WriteText(117.5, 86, expandeespacios(ajustaa($r['TEGT'], 5)));
        
        $r = ($this->get_titulados());
        $UNO=$r['THM18']+$r['TH18']+$r['TH19'];
        $this->mpdf->WriteText(159.5, 59, expandeespacios(ajustaa($UNO, 5)));
        $UNO=$r['TH20']+$r['TH21']+$r['TH22']+$r['TH23']+$r['TH24'];
        $this->mpdf->WriteText(159.5, 65, expandeespacios(ajustaa($UNO, 5)));
        $UNO=$r['TH25']+$r['TH26']+$r['TH27']+$r['TH28']+$r['TH29'];
        $this->mpdf->WriteText(159.5, 71, expandeespacios(ajustaa($UNO, 5)));
        $UNO=$r['TH3034']+$r['TH3539']+$r['THM39'];
        $this->mpdf->WriteText(159.5, 77.5, expandeespacios(ajustaa($UNO, 5)));
        $this->mpdf->WriteText(159.5, 86, expandeespacios(ajustaa($r['TTIH'], 5)));
        
        $UNO=$r['TMM18']+$r['TM18']+$r['TM19'];
        $this->mpdf->WriteText(193.5, 59, expandeespacios(ajustaa($UNO, 5)));
        $UNO=$r['TM20']+$r['TM21']+$r['TM22']+$r['TM23']+$r['TM24'];
        $this->mpdf->WriteText(193.5, 65, expandeespacios(ajustaa($UNO, 5)));
        $UNO=$r['TM25']+$r['TM26']+$r['TM27']+$r['TM28']+$r['TM29'];
        $this->mpdf->WriteText(193.5, 71, expandeespacios(ajustaa($UNO, 5)));
        $UNO=$r['TM3034']+$r['TM3539']+$r['TMM39'];
        $this->mpdf->WriteText(193.5, 77.5, expandeespacios(ajustaa($UNO, 5)));
        $this->mpdf->WriteText(193.5, 86, expandeespacios(ajustaa($r['TTIM'], 5)));
        
        $UNO=$r['TTM18']+$r['TT18']+$r['TT19'];
        $this->mpdf->WriteText(226, 59, expandeespacios(ajustaa($UNO, 5)));
        $UNO=$r['TT20']+$r['TT21']+$r['TT22']+$r['TT23']+$r['TT24'];
        $this->mpdf->WriteText(226, 65, expandeespacios(ajustaa($UNO, 5)));
        $UNO=$r['TT25']+$r['TT26']+$r['TT27']+$r['TT28']+$r['TT29'];
        $this->mpdf->WriteText(226, 71, expandeespacios(ajustaa($UNO, 5)));
        $UNO=$r['TT3034']+$r['TT3539']+$r['TTM39'];
        $this->mpdf->WriteText(226, 77.5, expandeespacios(ajustaa($UNO, 5)));
        $this->mpdf->WriteText(226, 86, expandeespacios(ajustaa($r['TTIT'], 5)));
    }

    function hoja5() {
        extract($this->get_generales());
        
        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest', array('pagina' => sprintf("%02d", 5)), true);
        $this->mpdf->WriteHTML($vista);
        
        $anioinicio = substr($FE_INI_PER, 0, -4);
        $this->mpdf->WriteText(142, 55.5, expandeespacios($anioinicio));
        $mesinicio = substr($FE_INI_PER, 4, -2);
        $this->mpdf->WriteText(177, 55.5, expandeespacios($mesinicio));
        $diainicio = substr($FE_INI_PER, 6);
        $this->mpdf->WriteText(202, 55.5, expandeespacios($diainicio));
        //this->mpdf->WriteText(142, 55.5, expandeespacios('2011'));
        //$this->mpdf->WriteText(177, 55.5, expandeespacios('08'));
        //$this->mpdf->WriteText(217, 58, expandeespacios(ajustaa($DIA, 2)));
        extract($this->get_ingreso());
        $this->mpdf->WriteText(142, 97, expandeespacios(ajustaa($LOFE, 4)));
        $this->mpdf->WriteText(138, 143, expandeespacios(ajustaa($SOLH, 4)));
        $this->mpdf->WriteText(169, 143, expandeespacios(ajustaa($SOLM, 4)));
        $this->mpdf->WriteText(204.5, 143, expandeespacios(ajustaa($TSOL, 4)));
        $this->mpdf->WriteText(234.5, 143, expandeespacios(ajustaa($TSOL_DIS, 4)));
        
        $this->mpdf->WriteText(138, 188, expandeespacios(ajustaa($TNIH, 4)));
        $this->mpdf->WriteText(169, 188, expandeespacios(ajustaa($TNIM, 4)));
        $this->mpdf->WriteText(204.5, 188, expandeespacios(ajustaa($TNIT, 4)));
        $this->mpdf->WriteText(234.5, 188, expandeespacios(ajustaa($TOT_NIDIS, 4)));
        
    }

    function hoja6() {
        extract($this->get_generales());
        extract($this->get_ingreso());
        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest', array('pagina' => sprintf("%02d", 6)), true);
        $this->mpdf->WriteHTML($vista);
        $b = 55;
        $this->mpdf->WriteText(88, $b, expandeespacios(ajustaa($B1, 4)));
        $this->mpdf->WriteText(88, $b + 6, expandeespacios(ajustaa($B2, 4)));
        $this->mpdf->WriteText(88, $b + 12, expandeespacios(ajustaa($B3, 4)));
        $this->mpdf->WriteText(88, $b + 18, expandeespacios(ajustaa($B4, 4)));

        $b = 81;
        $this->mpdf->WriteText(88, $b, expandeespacios(ajustaa($B5, 4)));
        $this->mpdf->WriteText(88, $b + 6, expandeespacios(ajustaa($B6, 4)));
        $this->mpdf->WriteText(88, $b + 12, expandeespacios(ajustaa($B7, 4)));
        $this->mpdf->WriteText(88, $b + 18, expandeespacios(ajustaa($B8, 4)));

        $b = 107;
        $this->mpdf->WriteText(88, $b, expandeespacios(ajustaa($B9, 4)));
        $this->mpdf->WriteText(88, $b + 6, expandeespacios(ajustaa($B10, 4)));
        $this->mpdf->WriteText(88, $b + 12, expandeespacios(ajustaa($B11, 4)));
        $this->mpdf->WriteText(88, $b + 18, expandeespacios(ajustaa($B12, 4)));

        $b = 133;
        $this->mpdf->WriteText(88, $b, expandeespacios(ajustaa($B13, 4)));
        $this->mpdf->WriteText(88, $b + 6, expandeespacios(ajustaa($B14, 4)));
        $this->mpdf->WriteText(88, $b + 12, expandeespacios(ajustaa($B15, 4)));
        $this->mpdf->WriteText(88, $b + 18, expandeespacios(ajustaa($B16, 4)));

        $b = 55;
        $this->mpdf->WriteText(156, $b, expandeespacios(ajustaa($B17, 4)));
        $this->mpdf->WriteText(156, $b + 6, expandeespacios(ajustaa($B18, 4)));
        $this->mpdf->WriteText(156, $b + 12, expandeespacios(ajustaa($B19, 4)));
        $this->mpdf->WriteText(156, $b + 18, expandeespacios(ajustaa($B20, 4)));
        $b = 81;
        $this->mpdf->WriteText(156, $b, expandeespacios(ajustaa($B21, 4)));
        $this->mpdf->WriteText(156, $b + 6, expandeespacios(ajustaa($B22, 4)));
        $this->mpdf->WriteText(156, $b + 12, expandeespacios(ajustaa($B23, 4)));
        $this->mpdf->WriteText(156, $b + 18, expandeespacios(ajustaa($B24, 4)));
        $b = 107;
        $this->mpdf->WriteText(156, $b, expandeespacios(ajustaa($B25, 4)));
        $this->mpdf->WriteText(156, $b + 6, expandeespacios(ajustaa($B26, 4)));
        $this->mpdf->WriteText(156, $b + 12, expandeespacios(ajustaa($B27, 4)));
        $this->mpdf->WriteText(156, $b + 18, expandeespacios(ajustaa($B28, 4)));
        $b = 133.5;
        $this->mpdf->WriteText(156, $b, expandeespacios(ajustaa($B29, 4)));
        $this->mpdf->WriteText(156, $b + 6, expandeespacios(ajustaa($B30, 4)));
        $this->mpdf->WriteText(156, $b + 12, expandeespacios(ajustaa($B31, 4)));
        $this->mpdf->WriteText(156, $b + 18, expandeespacios(ajustaa($B32, 4)));

        $b = 54;
        $this->mpdf->WriteText(237, $b, expandeespacios(ajustaa($BEU, 4)));
        $this->mpdf->WriteText(237, $b + 6, expandeespacios(ajustaa($BCA, 4)));
        $this->mpdf->WriteText(237, $b + 12, expandeespacios(ajustaa($BCC, 4)));
        $this->mpdf->WriteText(237, $b + 18, expandeespacios(ajustaa($BSU, 4)));
        $this->mpdf->WriteText(237, $b + 24, expandeespacios(ajustaa($BAF, 4)));
        $this->mpdf->WriteText(237, $b + 30, expandeespacios(ajustaa($BAS, 4)));
        $this->mpdf->WriteText(237, $b + 36, expandeespacios(ajustaa($BEUR, 4)));
        $this->mpdf->WriteText(237, $b + 42, expandeespacios(ajustaa($BOC, 4)));

        $this->mpdf->WriteText(236, 152, expandeespacios(ajustaa($TBAC, 4)));
        
        $this->mpdf->WriteText(207, 173.5, expandeespacios(ajustaa($N30, 5)));
        $this->mpdf->WriteText(207, 179.5, expandeespacios(ajustaa($ND30, 5)));
        $this->mpdf->WriteText(207, 185.5, expandeespacios(ajustaa($N157, 5)));
        $this->mpdf->WriteText(207, 191.5, expandeespacios(ajustaa($TNAC_OTPA, 5)));
        $this->mpdf->WriteText(207, 200.5, expandeespacios(ajustaa($TNAC, 5)));
    }

    function hoja7() {
        extract($this->get_generales());
        $r = ($this->get_permanencia());       
        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest', array('pagina' => sprintf("%02d", 7)), true);
        $this->mpdf->WriteHTML($vista);
        
        $x=40;
        $y=133.5;
        $cero=0;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['AV1H'], 4)));
        if ($DUR==4){
            $this->mpdf->WriteText($y, $x+7, expandeespacios(ajustaa($r['AV2H']+$r['AV3H']+$r['AV4H']+$r['AV5H']+$r['AV6H'], 4)));
            $this->mpdf->WriteText($y, $x+14, expandeespacios(ajustaa($cero, 4)));
            $this->mpdf->WriteText($y, $x+21, expandeespacios(ajustaa($cero, 4)));
            $this->mpdf->WriteText($y, $x+28, expandeespacios(ajustaa($cero, 4)));
            $this->mpdf->WriteText($y, $x+35, expandeespacios(ajustaa($cero, 4)));
        }
        if ($DUR==5||$DUR==6){
            $this->mpdf->WriteText($y, $x+7, expandeespacios(ajustaa($r['AV2H'], 4)));
            $this->mpdf->WriteText($y, $x+14, expandeespacios(ajustaa($r['AV3H']+$r['AV4H']+$r['AV5H']+$r['AV6H'], 4)));
            $this->mpdf->WriteText($y, $x+21, expandeespacios(ajustaa($cero, 4)));
            $this->mpdf->WriteText($y, $x+28, expandeespacios(ajustaa($cero, 4)));
            $this->mpdf->WriteText($y, $x+35, expandeespacios(ajustaa($cero, 4)));
            
        }
        if ($DUR==7||$DUR==8){
            $this->mpdf->WriteText($y, $x+7, expandeespacios(ajustaa($r['AV2H'], 4)));
            $this->mpdf->WriteText($y, $x+14, expandeespacios(ajustaa($r['AV3H'], 4)));
            $this->mpdf->WriteText($y, $x+21, expandeespacios(ajustaa($r['AV4H']+$r['AV5H']+$r['AV6H'], 4)));
            $this->mpdf->WriteText($y, $x+28, expandeespacios(ajustaa($cero, 4)));
            $this->mpdf->WriteText($y, $x+35, expandeespacios(ajustaa($cero, 4)));
        }
        if ($DUR==9||$DUR==10){
            $this->mpdf->WriteText($y, $x+7, expandeespacios(ajustaa($r['AV2H'], 4)));
            $this->mpdf->WriteText($y, $x+14, expandeespacios(ajustaa($r['AV3H'], 4)));
            $this->mpdf->WriteText($y, $x+21, expandeespacios(ajustaa($r['AV4H'], 4)));
            $this->mpdf->WriteText($y, $x+28, expandeespacios(ajustaa($r['AV5H']+$r['AV6H'], 4)));
            $this->mpdf->WriteText($y, $x+35, expandeespacios(ajustaa($cero, 4)));
        }
        if ($DUR==11||$DUR>=12){
            $this->mpdf->WriteText($y, $x+7, expandeespacios(ajustaa($r['AV2H'], 4)));
            $this->mpdf->WriteText($y, $x+14, expandeespacios(ajustaa($r['AV3H'], 4)));
            $this->mpdf->WriteText($y, $x+21, expandeespacios(ajustaa($r['AV4H'], 4)));
            $this->mpdf->WriteText($y, $x+28, expandeespacios(ajustaa($r['AV5H'], 4)));
            $this->mpdf->WriteText($y, $x+35, expandeespacios(ajustaa($r['AV6H']+$r['AV7H']+$r['AV8H']+$r['AV9H']+$r['AV10H'], 4)));            
        }
        $this->mpdf->WriteText($y, $x+42, expandeespacios(ajustaa($r['TAVH'], 4)));
        
        $x=40;
        $y=172;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['AV1M'], 4)));
        
        if ($DUR==4){
            $this->mpdf->WriteText($y, $x+7, expandeespacios(ajustaa($r['AV2M']+$r['AV3M']+$r['AV4M']+$r['AV5M']+$r['AV6M'], 4)));
            $this->mpdf->WriteText($y, $x+14, expandeespacios(ajustaa($cero, 4)));
            $this->mpdf->WriteText($y, $x+21, expandeespacios(ajustaa($cero, 4)));
            $this->mpdf->WriteText($y, $x+28, expandeespacios(ajustaa($cero, 4)));
            $this->mpdf->WriteText($y, $x+35, expandeespacios(ajustaa($cero, 4)));
        }
        if ($DUR==5||$DUR==6){
            $this->mpdf->WriteText($y, $x+7, expandeespacios(ajustaa($r['AV2M'], 4)));
            $this->mpdf->WriteText($y, $x+14, expandeespacios(ajustaa($r['AV3M']+$r['AV4M']+$r['AV5M']+$r['AV6M'], 4)));
            $this->mpdf->WriteText($y, $x+21, expandeespacios(ajustaa($cero, 4)));
            $this->mpdf->WriteText($y, $x+28, expandeespacios(ajustaa($cero, 4)));
            $this->mpdf->WriteText($y, $x+35, expandeespacios(ajustaa($cero, 4)));
            
        }
        if ($DUR==7||$DUR==8){
            $this->mpdf->WriteText($y, $x+7, expandeespacios(ajustaa($r['AV2M'], 4)));
            $this->mpdf->WriteText($y, $x+14, expandeespacios(ajustaa($r['AV3M'], 4)));
            $this->mpdf->WriteText($y, $x+21, expandeespacios(ajustaa($r['AV4M']+$r['AV5M']+$r['AV6M'], 4)));
            $this->mpdf->WriteText($y, $x+28, expandeespacios(ajustaa($cero, 4)));
            $this->mpdf->WriteText($y, $x+35, expandeespacios(ajustaa($cero, 4)));
        }
        if ($DUR==9||$DUR==10){
            $this->mpdf->WriteText($y, $x+7, expandeespacios(ajustaa($r['AV2M'], 4)));
            $this->mpdf->WriteText($y, $x+14, expandeespacios(ajustaa($r['AV3M'], 4)));
            $this->mpdf->WriteText($y, $x+21, expandeespacios(ajustaa($r['AV4M'], 4)));
            $this->mpdf->WriteText($y, $x+28, expandeespacios(ajustaa($r['AV5M']+$r['AV6M'], 4)));
            $this->mpdf->WriteText($y, $x+35, expandeespacios(ajustaa($cero, 4)));
        }
        if ($DUR==11||$DUR>=12){
            $this->mpdf->WriteText($y, $x+7, expandeespacios(ajustaa($r['AV2M'], 4)));
            $this->mpdf->WriteText($y, $x+14, expandeespacios(ajustaa($r['AV3M'], 4)));
            $this->mpdf->WriteText($y, $x+21, expandeespacios(ajustaa($r['AV4M'], 4)));
            $this->mpdf->WriteText($y, $x+28, expandeespacios(ajustaa($r['AV5M'], 4)));
            $this->mpdf->WriteText($y, $x+35, expandeespacios(ajustaa($r['AV6M']+$r['AV7M']+$r['AV8M']+$r['AV9M']+$r['AV10M'], 4)));         
        }
      
        $this->mpdf->WriteText($y, $x+42, expandeespacios(ajustaa($r['TAVM'], 4)));
        
        $x=40;
        $y=210;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['PRIM'], 4)));
        
        if ($DUR==4){
            $this->mpdf->WriteText($y, $x+7, expandeespacios(ajustaa($r['SEGU']+$r['TERC']+$r['CUAR']+$r['QUIN']+$r['SEXT'], 4)));
            $this->mpdf->WriteText($y, $x+14, expandeespacios(ajustaa($cero, 4)));
            $this->mpdf->WriteText($y, $x+21, expandeespacios(ajustaa($cero, 4)));
            $this->mpdf->WriteText($y, $x+28, expandeespacios(ajustaa($cero, 4)));
            $this->mpdf->WriteText($y, $x+35, expandeespacios(ajustaa($cero, 4)));
        }
        if ($DUR==5||$DUR==6){
            $this->mpdf->WriteText($y, $x+7, expandeespacios(ajustaa($r['SEGU'], 4)));
            $this->mpdf->WriteText($y, $x+14, expandeespacios(ajustaa($r['TERC']+$r['CUAR']+$r['QUIN']+$r['SEXT'], 4)));
            $this->mpdf->WriteText($y, $x+21, expandeespacios(ajustaa($cero, 4)));
            $this->mpdf->WriteText($y, $x+28, expandeespacios(ajustaa($cero, 4)));
            $this->mpdf->WriteText($y, $x+35, expandeespacios(ajustaa($cero, 4)));
            
        }
        if ($DUR==7||$DUR==8){
            $this->mpdf->WriteText($y, $x+7, expandeespacios(ajustaa($r['SEGU'], 4)));
            $this->mpdf->WriteText($y, $x+14, expandeespacios(ajustaa($r['TERC'], 4)));
            $this->mpdf->WriteText($y, $x+21, expandeespacios(ajustaa($r['CUAR']+$r['QUIN']+$r['SEXT'], 4)));
            $this->mpdf->WriteText($y, $x+28, expandeespacios(ajustaa($cero, 4)));
            $this->mpdf->WriteText($y, $x+35, expandeespacios(ajustaa($cero, 4)));
        }
        if ($DUR==9||$DUR==10){
            $this->mpdf->WriteText($y, $x+7, expandeespacios(ajustaa($r['SEGU'], 4)));
            $this->mpdf->WriteText($y, $x+14, expandeespacios(ajustaa($r['TERC'], 4)));
            $this->mpdf->WriteText($y, $x+21, expandeespacios(ajustaa($r['CUAR'], 4)));
            $this->mpdf->WriteText($y, $x+28, expandeespacios(ajustaa($r['QUIN']+$r['SEXT'], 4)));
            $this->mpdf->WriteText($y, $x+35, expandeespacios(ajustaa($cero, 4)));
        }
        if ($DUR==11||$DUR>=12){
            $this->mpdf->WriteText($y, $x+7, expandeespacios(ajustaa($r['SEGU'], 4)));
            $this->mpdf->WriteText($y, $x+14, expandeespacios(ajustaa($r['TERC'], 4)));
            $this->mpdf->WriteText($y, $x+21, expandeespacios(ajustaa($r['CUAR'], 4)));
            $this->mpdf->WriteText($y, $x+28, expandeespacios(ajustaa($r['QUIN'], 4)));
            $this->mpdf->WriteText($y, $x+35, expandeespacios(ajustaa($r['SEXT']+$r['SEPT']+$r['OCTA']+$r['NOVE']+$r['DECI'], 4)));         
        }
        
        
        
        $this->mpdf->WriteText($y, $x+42, expandeespacios(ajustaa($r['TAVA'], 4)));
        
        $x=40;
        $y=250;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['A1DT'], 3)));
        
         if ($DUR==4){
            $this->mpdf->WriteText($y, $x+7, expandeespacios(ajustaa($r['A2DT']+$r['A3DT']+$r['A4DT']+$r['A5DT']+$r['A6DT'], 3)));
            $this->mpdf->WriteText($y, $x+14, expandeespacios(ajustaa($cero, 3)));
            $this->mpdf->WriteText($y, $x+21, expandeespacios(ajustaa($cero, 3)));
            $this->mpdf->WriteText($y, $x+28, expandeespacios(ajustaa($cero, 3)));
            $this->mpdf->WriteText($y, $x+35, expandeespacios(ajustaa($cero, 3)));
        }
        if ($DUR==5||$DUR==6){
            $this->mpdf->WriteText($y, $x+7, expandeespacios(ajustaa($r['A2DT'], 3)));
            $this->mpdf->WriteText($y, $x+14, expandeespacios(ajustaa($r['A3DT']+$r['A4DT']+$r['A5DT']+$r['A6DT'], 3)));
            $this->mpdf->WriteText($y, $x+21, expandeespacios(ajustaa($cero, 3)));
            $this->mpdf->WriteText($y, $x+28, expandeespacios(ajustaa($cero, 3)));
            $this->mpdf->WriteText($y, $x+35, expandeespacios(ajustaa($cero, 3)));
            
        }
        if ($DUR==7||$DUR==8){
            $this->mpdf->WriteText($y, $x+7, expandeespacios(ajustaa($r['A2DT'], 3)));
            $this->mpdf->WriteText($y, $x+14, expandeespacios(ajustaa($r['A3DT'], 3)));
            $this->mpdf->WriteText($y, $x+21, expandeespacios(ajustaa($r['A4DT']+$r['A5DT']+$r['A6DT'], 3)));
            $this->mpdf->WriteText($y, $x+28, expandeespacios(ajustaa($cero, 3)));
            $this->mpdf->WriteText($y, $x+35, expandeespacios(ajustaa($cero, 3)));
        }
        if ($DUR==9||$DUR==10){
            $this->mpdf->WriteText($y, $x+7, expandeespacios(ajustaa($r['A2DT'], 3)));
            $this->mpdf->WriteText($y, $x+14, expandeespacios(ajustaa($r['A3DT'], 3)));
            $this->mpdf->WriteText($y, $x+21, expandeespacios(ajustaa($r['A4DT'], 3)));
            $this->mpdf->WriteText($y, $x+28, expandeespacios(ajustaa($r['A5DT']+$r['A6DT'], 3)));
            $this->mpdf->WriteText($y, $x+35, expandeespacios(ajustaa($cero, 3)));
        }
        if ($DUR==11||$DUR>=12){
            $this->mpdf->WriteText($y, $x+7, expandeespacios(ajustaa($r['A2DT'], 3)));
            $this->mpdf->WriteText($y, $x+14, expandeespacios(ajustaa($r['A3DT'], 3)));
            $this->mpdf->WriteText($y, $x+21, expandeespacios(ajustaa($r['A4DT'], 3)));
            $this->mpdf->WriteText($y, $x+28, expandeespacios(ajustaa($r['A5DT'], 3)));
            $this->mpdf->WriteText($y, $x+35, expandeespacios(ajustaa($r['A6DT']+$r['A7DT']+$r['A8DT']+$r['A9DT']+$r['A10DT'], 3)));        
        }      
            
        $this->mpdf->WriteText($y, $x+42, expandeespacios(ajustaa($r['TADT'], 3)));
        
        //aqui va el apartado dos de la pagina 7 de lic
        
        $x=109.5;
        $y=128;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['A119'], 4)));
        $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($r['A12024'], 4)));
        $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($r['A12529'], 4)));
        $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($r['A130'], 4)));
        $this->mpdf->WriteText($y, $x+25.5, expandeespacios(ajustaa($r['TAV1'], 4)));
   
           $CUATRO19 = $r['A219'];
           $CUATRO20A24 = $r['A22024'];
           $CUATRO25A29 = $r['A22529'];
           $CUATRO30 = $r['A230'];
           $CUATROTOTAL = $r['TAV2'];
           
           $SEIS19 = $r['A319'];
           $SEIS20A24 = $r['A32024'];
           $SEIS25A29 = $r['A32529'];
           $SEIS30 = $r['A330'];
           $SEISTOTAL = $r['TAV3'];
           
           $OCHO19 = $r['A419'];
           $OCHO20A24 = $r['A42024'];
           $OCHO25A29 = $r['A42529'];
           $OCHO30 = $r['A430'];
           $OCHOTOTAL = $r['TAV4'];
           
           $DIEZ19 = $r['A519'];
           $DIEZ20A24 = $r['A52024'];
           $DIEZ25A29 = $r['A52529'];
           $DIEZ30 = $r['A530'];
           $DIEZTOTAL = $r['TAV5'];
           
           $DOCE19 = $r['A619'];
           $DOCE20A24 = $r['A62024'];
           $DOCE25A29 = $r['A62529'];
           $DOCE30 = $r['A630'];
           $DOCETOTAL = $r['TAV6'];
  
        if ($DUR==4){
           $CUATRO19 = $r['A219']+$r['A319']+$r['A419']+$r['A519']+$r['A619'];
           $CUATRO20A24 = $r['A22024']+$r['A32024']+$r['A42024']+$r['A52024']+$r['A62024'];
           $CUATRO25A29 = $r['A22529']+$r['A32529']+$r['A42529']+$r['A52529']+$r['A62529'];
           $CUATRO30 = $r['A230']+$r['A330']+$r['A430']+$r['A530']+$r['A630'];
           $CUATROTOTAL = $r['TAV2']+$r['TAV3']+$r['TAV4']+$r['TAV5']+$r['TAV6'];
           
           $SEIS19 = 0;
           $SEIS20A24 = 0;
           $SEIS25A29 = 0;
           $SEIS30 = 0;
           $SEISTOTAL = 0;
           $OCHO19 = 0;
           $OCHO20A24 = 0;
           $OCHO25A29 = 0;
           $OCHO30 = 0;
           $OCHOTOTAL = 0;
           $DIEZ19 = 0;
           $DIEZ20A24 = 0;
           $DIEZ25A29 = 0;
           $DIEZ30 = 0;
           $DIEZTOTAL = 0;
           $DOCE19 = 0;
           $DOCE20A24 = 0;
           $DOCE25A29 = 0;
           $DOCE30 = 0;
           $DOCETOTAL = 0;
        }
        if ($DUR==5 || $DUR==6){
           $SEIS19 = $r['A319']+$r['A419']+$r['A519']+$r['A619'];
           $SEIS20A24 = $r['A32024']+$r['A42024']+$r['A52024']+$r['A62024'];
           $SEIS25A29 = $r['A32529']+$r['A42529']+$r['A52529']+$r['A62529'];
           $SEIS30 = $r['A330']+$r['A430']+$r['A530']+$r['A630'];
           $SEISTOTAL = $r['TAV3']+$r['TAV4']+$r['TAV5']+$r['TAV6']; 
           $OCHO19 = 0;
           $OCHO20A24 = 0;
           $OCHO25A29 = 0;
           $OCHO30 = 0;
           $OCHOTOTAL = 0;
           $DIEZ19 = 0;
           $DIEZ20A24 = 0;
           $DIEZ25A29 = 0;
           $DIEZ30 = 0;
           $DIEZTOTAL = 0;
           $DOCE19 = 0;
           $DOCE20A24 = 0;
           $DOCE25A29 = 0;
           $DOCE30 = 0;
           $DOCETOTAL = 0;
        }
        if ($DUR==7 || $DUR==8){
           $OCHO19 = $r['A419']+$r['A519']+$r['A619'];
           $OCHO20A24 = $r['A42024']+$r['A52024']+$r['A62024'];
           $OCHO25A29 = $r['A42529']+$r['A52529']+$r['A62529'];
           $OCHO30 = $r['A430']+$r['A530']+$r['A630'];
           $OCHOTOTAL = $r['TAV4']+$r['TAV5']+$r['TAV6'];  
           $DIEZ19 = 0;
           $DIEZ20A24 = 0;
           $DIEZ25A29 = 0;
           $DIEZ30 = 0;
           $DIEZTOTAL = 0;
           $DOCE19 = 0;
           $DOCE20A24 = 0;
           $DOCE25A29 = 0;
           $DOCE30 = 0;
           $DOCETOTAL = 0;
        }
        if ($DUR==9 || $DUR==10){
           $DIEZ19 = $r['A519']+$r['A619'];
           $DIEZ20A24 = $r['A52024']+$r['A62024'];
           $DIEZ25A29 = $r['A52529']+$r['A62529'];
           $DIEZ30 = $r['A530']+$r['A630'];
           $DIEZTOTAL = $r['TAV5']+$r['TAV6']; 
           
           $DOCE19 = 0;
           $DOCE20A24 = 0;
           $DOCE25A29 = 0;
           $DOCE30 = 0;
           $DOCETOTAL = 0;
        }
               
        $x=109.5;
        $y=147;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($CUATRO19, 4)));
        $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($CUATRO20A24, 4)));
        $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($CUATRO25A29, 4)));
        $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($CUATRO30, 4)));
        $this->mpdf->WriteText($y, $x+25.5, expandeespacios(ajustaa($CUATROTOTAL, 4)));
      
        $x=109.5;
        $y=166.5;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($SEIS19, 4)));
        $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($SEIS20A24, 4)));
        $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($SEIS25A29, 4)));
        $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($SEIS30, 4)));
        $this->mpdf->WriteText($y, $x+25.5, expandeespacios(ajustaa($SEISTOTAL, 4)));
        
        $x=109.5;
        $y=186;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($OCHO19, 4)));
        $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($OCHO20A24, 4)));
        $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($OCHO25A29, 4)));
        $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($OCHO30, 4)));
        $this->mpdf->WriteText($y, $x+25.5, expandeespacios(ajustaa($OCHOTOTAL, 4)));
        
        $x=109.5;
        $y=205.5;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($DIEZ19, 4)));
        $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($DIEZ20A24, 4)));
        $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($DIEZ25A29, 4)));
        $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($DIEZ30, 4)));
        $this->mpdf->WriteText($y, $x+25.5, expandeespacios(ajustaa($DIEZTOTAL, 4)));
        
        $x=109.5;
        $y=225;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($DOCE19, 4)));
        $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($DOCE20A24, 4)));
        $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($DOCE25A29, 4)));
        $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($DOCE30, 4)));
        $this->mpdf->WriteText($y, $x+25.5, expandeespacios(ajustaa($DOCETOTAL, 4)));
        
        //TOTALES DE POBLACION
        
        $x=109.5;
        $y=245;
        
        if ($r['TAV19']>999){
            $mil=substr($r['TAV19'], 0, -3);
            $this->mpdf->WriteText(242, $x, expandeespacios(ajustaa($mil, 2)));
            $mil=substr($r['TAV19'], 1);
            $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($mil, 4)));
        }else{
            $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['TAV19'], 4)));
        }  
        if ($r['TAV2024']>999){
            $mil=substr($r['TAV2024'], 0, -3);
            $this->mpdf->WriteText(242, $x+6, expandeespacios(ajustaa($mil, 2)));
            $mil=substr($r['TAV2024'], 1);
            $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($mil, 4)));
        }else{
            $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($r['TAV2024'], 4)));
        }        
        $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($r['TAV2529'], 4)));
        $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($r['TAV30'], 4)));
        if ($r['TOTAED']>999){
            $mil=substr($r['TOTAED'], 0, -3);
            $this->mpdf->WriteText(242, $x+25.5, expandeespacios(ajustaa($mil, 2)));
            $mil=substr($r['TOTAED'], 1);
            $this->mpdf->WriteText($y, $x+25.5, expandeespacios(ajustaa($mil, 4)));
        }else{
            $this->mpdf->WriteText($y, $x+25.5, expandeespacios(ajustaa($r['TOTAED'], 4)));
        }
        
        
        
        $this->mpdf->WriteText(166.5, 152.5, expandeespacios(ajustaa($r['POB_AB'], 4)));
 
        $this->mpdf->WriteText(205, 152.5, expandeespacios(ajustaa($r['POB_VI_DI'], 4)));
        
        $this->mpdf->WriteText(124.5, 180, expandeespacios(ajustaa($r['HDIS'], 4)));
        $this->mpdf->WriteText(152.5, 180, expandeespacios(ajustaa($r['MDIS'], 4)));
        $this->mpdf->WriteText(184, 180, expandeespacios(ajustaa($r['TDIS'], 4)));
        
        $this->mpdf->WriteText(124.5, 199, expandeespacios(ajustaa($r['MHLI'], 4)));
        $this->mpdf->WriteText(152.5, 199, expandeespacios(ajustaa($r['MMLI'], 4)));
        $this->mpdf->WriteText(184, 199, expandeespacios(ajustaa($r['TMLI'], 4)));
        $this->mpdf->WriteText(216, 199, expandeespacios(ajustaa($r['TLID'], 3)));
    }

    function hoja8() {  
        
        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest', array('pagina' => sprintf("%02d", 8)), true);
        $this->mpdf->WriteHTML($vista);
    }

    function hoja9() {
       extract($this->get_generales());
        $r = ($this->get_ingreso());         
        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest', array('pagina' => sprintf("%02d", 9)), true);
        $this->mpdf->WriteHTML($vista);

        $x=70.5;
        $this->mpdf->WriteText(54, $x, expandeespacios(ajustaa($r['NIHM18'], 5)));
        $this->mpdf->WriteText(54, $x+6, expandeespacios(ajustaa($r['NIH18'], 5)));
        $this->mpdf->WriteText(54, $x+12, expandeespacios(ajustaa($r['NIH19'], 5)));
        $this->mpdf->WriteText(54, $x+18, expandeespacios(ajustaa($r['NIH20'], 5)));
        $this->mpdf->WriteText(54, $x+24, expandeespacios(ajustaa($r['NIH21'], 5)));
        $this->mpdf->WriteText(54, $x+30, expandeespacios(ajustaa($r['NIH22'], 5)));
        $this->mpdf->WriteText(54, $x+36, expandeespacios(ajustaa($r['NIH23'], 5)));
        $this->mpdf->WriteText(54, $x+42, expandeespacios(ajustaa($r['NIH24'], 5)));
        $this->mpdf->WriteText(54, $x+48, expandeespacios(ajustaa($r['NIH25'], 5)));
        $this->mpdf->WriteText(54, $x+54, expandeespacios(ajustaa($r['NIH26'], 5)));
        $this->mpdf->WriteText(54, $x+60, expandeespacios(ajustaa($r['NIH27'], 5)));
        $this->mpdf->WriteText(54, $x+66, expandeespacios(ajustaa($r['NIH28'], 5)));
        $this->mpdf->WriteText(54, $x+72, expandeespacios(ajustaa($r['NIH29'], 5)));
        $this->mpdf->WriteText(54, $x+78, expandeespacios(ajustaa($r['NIH3034'], 5)));
        $this->mpdf->WriteText(54, $x+84, expandeespacios(ajustaa($r['NIH3539'], 5)));
        $this->mpdf->WriteText(54, $x+90, expandeespacios(ajustaa($r['NIHM39'], 5)));
        $this->mpdf->WriteText(54, $x+103, expandeespacios(ajustaa($r['TNIH'], 5)));

        $x=70.5;
        $y=87;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['NIMM18'], 5)));
        $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($r['NIM18'], 5)));
        $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($r['NIM19'], 5)));
        $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($r['NIM20'], 5)));
        $this->mpdf->WriteText($y, $x+24, expandeespacios(ajustaa($r['NIM21'], 5)));
        $this->mpdf->WriteText($y, $x+30, expandeespacios(ajustaa($r['NIM22'], 5)));
        $this->mpdf->WriteText($y, $x+36, expandeespacios(ajustaa($r['NIM23'], 5)));
        $this->mpdf->WriteText($y, $x+42, expandeespacios(ajustaa($r['NIM24'], 5)));
        $this->mpdf->WriteText($y, $x+48, expandeespacios(ajustaa($r['NIM25'], 5)));
        $this->mpdf->WriteText($y, $x+54, expandeespacios(ajustaa($r['NIM26'], 5)));
        $this->mpdf->WriteText($y, $x+60, expandeespacios(ajustaa($r['NIM27'], 5)));
        $this->mpdf->WriteText($y, $x+66, expandeespacios(ajustaa($r['NIM28'], 5)));
        $this->mpdf->WriteText($y, $x+72, expandeespacios(ajustaa($r['NIM29'], 5)));
        $this->mpdf->WriteText($y, $x+78, expandeespacios(ajustaa($r['NIM3034'], 5)));
        $this->mpdf->WriteText($y, $x+84, expandeespacios(ajustaa($r['NIM3539'], 5)));
        $this->mpdf->WriteText($y, $x+90, expandeespacios(ajustaa($r['NIMM39'], 5)));
        $this->mpdf->WriteText($y, $x+103, expandeespacios(ajustaa($r['TNIM'], 5)));

        $x=70.5;
        $y=120;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['TNIM18'], 5)));
        $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($r['TNI18'], 5)));
        $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($r['TNI19'], 5)));
        $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($r['TNI20'], 5)));
        $this->mpdf->WriteText($y, $x+24, expandeespacios(ajustaa($r['TNI21'], 5)));
        $this->mpdf->WriteText($y, $x+30, expandeespacios(ajustaa($r['TNI22'], 5)));
        $this->mpdf->WriteText($y, $x+36, expandeespacios(ajustaa($r['TNI23'], 5)));
        $this->mpdf->WriteText($y, $x+42, expandeespacios(ajustaa($r['TNI24'], 5)));
        $this->mpdf->WriteText($y, $x+48, expandeespacios(ajustaa($r['TNI25'], 5)));
        $this->mpdf->WriteText($y, $x+54, expandeespacios(ajustaa($r['TNI26'], 5)));
        $this->mpdf->WriteText($y, $x+60, expandeespacios(ajustaa($r['TNI27'], 5)));
        $this->mpdf->WriteText($y, $x+66, expandeespacios(ajustaa($r['TNI28'], 5)));
        $this->mpdf->WriteText($y, $x+72, expandeespacios(ajustaa($r['TNI29'], 5)));
        $this->mpdf->WriteText($y, $x+78, expandeespacios(ajustaa($r['TNI3034'], 5)));
        $this->mpdf->WriteText($y, $x+84, expandeespacios(ajustaa($r['TNI3539'], 5)));
        $this->mpdf->WriteText($y, $x+90, expandeespacios(ajustaa($r['TNIM39'], 5)));
        $this->mpdf->WriteText($y, $x+103, expandeespacios(ajustaa($r['TNIT'], 5)));

        $r = ($this->get_reingreso());
        $x=70.5;
        $y=162;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['RHM18'], 5)));
        $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($r['RH18'], 5)));
        $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($r['RH19'], 5)));
        $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($r['RH20'], 5)));
        $this->mpdf->WriteText($y, $x+24, expandeespacios(ajustaa($r['RH21'], 5)));
        $this->mpdf->WriteText($y, $x+30, expandeespacios(ajustaa($r['RH22'], 5)));
        $this->mpdf->WriteText($y, $x+36, expandeespacios(ajustaa($r['RH23'], 5)));
        $this->mpdf->WriteText($y, $x+42, expandeespacios(ajustaa($r['RH24'], 5)));
        $this->mpdf->WriteText($y, $x+48, expandeespacios(ajustaa($r['RH25'], 5)));
        $this->mpdf->WriteText($y, $x+54, expandeespacios(ajustaa($r['RH26'], 5)));
        $this->mpdf->WriteText($y, $x+60, expandeespacios(ajustaa($r['RH27'], 5)));
        $this->mpdf->WriteText($y, $x+66, expandeespacios(ajustaa($r['RH28'], 5)));
        $this->mpdf->WriteText($y, $x+72, expandeespacios(ajustaa($r['RH29'], 5)));
        $this->mpdf->WriteText($y, $x+78, expandeespacios(ajustaa($r['RH3034'], 5)));
        $this->mpdf->WriteText($y, $x+84, expandeespacios(ajustaa($r['RH3539'], 5)));
        $this->mpdf->WriteText($y, $x+90, expandeespacios(ajustaa($r['RHM39'], 5)));
        $this->mpdf->WriteText($y, $x+103, expandeespacios(ajustaa($r['TREH'], 5)));

        $x=70.5;
        $y=195;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['RMM18'], 5)));
        $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($r['RM18'], 5)));
        $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($r['RM19'], 5)));
        $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($r['RM20'], 5)));
        $this->mpdf->WriteText($y, $x+24, expandeespacios(ajustaa($r['RM21'], 5)));
        $this->mpdf->WriteText($y, $x+30, expandeespacios(ajustaa($r['RM22'], 5)));
        $this->mpdf->WriteText($y, $x+36, expandeespacios(ajustaa($r['RM23'], 5)));
        $this->mpdf->WriteText($y, $x+42, expandeespacios(ajustaa($r['RM24'], 5)));
        $this->mpdf->WriteText($y, $x+48, expandeespacios(ajustaa($r['RM25'], 5)));
        $this->mpdf->WriteText($y, $x+54, expandeespacios(ajustaa($r['RM26'], 5)));
        $this->mpdf->WriteText($y, $x+60, expandeespacios(ajustaa($r['RM27'], 5)));
        $this->mpdf->WriteText($y, $x+66, expandeespacios(ajustaa($r['RM28'], 5)));
        $this->mpdf->WriteText($y, $x+72, expandeespacios(ajustaa($r['RM29'], 5)));
        $this->mpdf->WriteText($y, $x+78, expandeespacios(ajustaa($r['RM3034'], 5)));
        $this->mpdf->WriteText($y, $x+84, expandeespacios(ajustaa($r['RM3539'], 5)));
        $this->mpdf->WriteText($y, $x+90, expandeespacios(ajustaa($r['RMM39'], 5)));
        $this->mpdf->WriteText($y, $x+103, expandeespacios(ajustaa($r['TREM'], 5)));

        $x=70.5;
        $y=227;
        $this->mpdf->WriteText($y, $x, expandeespacios(ajustaa($r['TRM18'], 5)));
        $this->mpdf->WriteText($y, $x+6, expandeespacios(ajustaa($r['TR18'], 5)));
        $this->mpdf->WriteText($y, $x+12, expandeespacios(ajustaa($r['TR19'], 5)));
        $this->mpdf->WriteText($y, $x+18, expandeespacios(ajustaa($r['TR20'], 5)));
        $this->mpdf->WriteText($y, $x+24, expandeespacios(ajustaa($r['TR21'], 5)));
        $this->mpdf->WriteText($y, $x+30, expandeespacios(ajustaa($r['TR22'], 5)));
        $this->mpdf->WriteText($y, $x+36, expandeespacios(ajustaa($r['TR23'], 5)));
        $this->mpdf->WriteText($y, $x+42, expandeespacios(ajustaa($r['TR24'], 5)));
        $this->mpdf->WriteText($y, $x+48, expandeespacios(ajustaa($r['TR25'], 5)));
        $this->mpdf->WriteText($y, $x+54, expandeespacios(ajustaa($r['TR26'], 5)));
        $this->mpdf->WriteText($y, $x+60, expandeespacios(ajustaa($r['TR27'], 5)));
        $this->mpdf->WriteText($y, $x+66, expandeespacios(ajustaa($r['TR28'], 5)));
        $this->mpdf->WriteText($y, $x+72, expandeespacios(ajustaa($r['TR29'], 5)));
        $this->mpdf->WriteText($y, $x+78, expandeespacios(ajustaa($r['TR3034'], 5)));
        $this->mpdf->WriteText($y, $x+84, expandeespacios(ajustaa($r['TR3539'], 5)));
        $this->mpdf->WriteText($y, $x+90, expandeespacios(ajustaa($r['TRM39'], 5)));
        $this->mpdf->WriteText($y, $x+103, expandeespacios(ajustaa($r['TRET'], 5)));
    }

    function hoja10() {
        extract($this->get_generales());        
        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest', array('pagina' => sprintf("%02d", 10)), true);
        $this->mpdf->WriteHTML($vista);

        $año = '2011';//ajustaa(date('Y'), 4);
        $this->mpdf->WriteText(193, 126, expandeespacios($año));
        $mes = '10';//ajustaa(date('m'), 2);
        $this->mpdf->WriteText(221, 126, expandeespacios($mes));
        $dia = '20';//ajustaa(date('d'), 2);
        $this->mpdf->WriteText(238, 126, expandeespacios($dia));
        $responsablecarrera = $SECRETARIO;
        $this->mpdf->WriteText(30, 121, $responsablecarrera);
        $responsablellenado = 'DR. RAGUEB CHAÍN REVUELTA';
        $this->mpdf->WriteText(35, 162, $responsablellenado);
    }

    /*function hoja11() {
        extract($this->get_generales());
        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest', array('pagina' => sprintf("%02d", 11)), true);
        $this->mpdf->WriteHTML($vista);
        $s = $this->claveuv;
        $this->mpdf->WriteText(15, 194, expandeespacios($s));
        $claveescuela = $FACU;
        $this->mpdf->WriteText(85, 194, expandeespacios($claveescuela));
        $clavecarrera = $CARR;
        $this->mpdf->WriteText(155, 194, expandeespacios($clavecarrera));
        $clavecarrera2 = $CARR2;
        $this->mpdf->WriteText(219, 194, expandeespacios($clavecarrera2));
    }

    function hoja12() {
        extract($this->get_generales());
        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest', array('pagina' => sprintf("%02d", 12)), true);
        $this->mpdf->WriteHTML($vista);

        $r = ($this->get_ingreso());
        $this->mpdf->WriteText(54, 75, expandeespacios(ajustaa($r['<18H'], 5)));
        $this->mpdf->WriteText(54, 81, expandeespacios(ajustaa($r['=18H'], 5)));
        $this->mpdf->WriteText(54, 87, expandeespacios(ajustaa($r['=19H'], 5)));
        $this->mpdf->WriteText(54, 93, expandeespacios(ajustaa($r['=20H'], 5)));
        $this->mpdf->WriteText(54, 99, expandeespacios(ajustaa($r['=21H'], 5)));
        $this->mpdf->WriteText(54, 105, expandeespacios(ajustaa($r['=22H'], 5)));
        $this->mpdf->WriteText(54, 111, expandeespacios(ajustaa($r['=23H'], 5)));
        $this->mpdf->WriteText(54, 117, expandeespacios(ajustaa($r['=24H'], 5)));
        $this->mpdf->WriteText(54, 123, expandeespacios(ajustaa($r['=25H'], 5)));
        $this->mpdf->WriteText(54, 129, expandeespacios(ajustaa($r['=26H'], 5)));
        $this->mpdf->WriteText(54, 135, expandeespacios(ajustaa($r['=27H'], 5)));
        $this->mpdf->WriteText(54, 141, expandeespacios(ajustaa($r['=28H'], 5)));
        $this->mpdf->WriteText(54, 147, expandeespacios(ajustaa($r['=29H'], 5)));
        $this->mpdf->WriteText(54, 153, expandeespacios(ajustaa($r['30_4H'], 5)));
        $this->mpdf->WriteText(54, 159, expandeespacios(ajustaa($r['35_9H'], 5)));
        $this->mpdf->WriteText(54, 165, expandeespacios(ajustaa($r['>39H'], 5)));
        $this->mpdf->WriteText(54, 177, expandeespacios(ajustaa($r['TNIH'], 5)));

        $this->mpdf->WriteText(87, 75, expandeespacios(ajustaa($r['<18M'], 5)));
        $this->mpdf->WriteText(87, 81, expandeespacios(ajustaa($r['=18M'], 5)));
        $this->mpdf->WriteText(87, 87, expandeespacios(ajustaa($r['=19M'], 5)));
        $this->mpdf->WriteText(87, 93, expandeespacios(ajustaa($r['=20M'], 5)));
        $this->mpdf->WriteText(87, 99, expandeespacios(ajustaa($r['=21M'], 5)));
        $this->mpdf->WriteText(87, 105, expandeespacios(ajustaa($r['=22M'], 5)));
        $this->mpdf->WriteText(87, 111, expandeespacios(ajustaa($r['=23M'], 5)));
        $this->mpdf->WriteText(87, 117, expandeespacios(ajustaa($r['=24M'], 5)));
        $this->mpdf->WriteText(87, 123, expandeespacios(ajustaa($r['=25M'], 5)));
        $this->mpdf->WriteText(87, 129, expandeespacios(ajustaa($r['=26M'], 5)));
        $this->mpdf->WriteText(87, 135, expandeespacios(ajustaa($r['=27M'], 5)));
        $this->mpdf->WriteText(87, 141, expandeespacios(ajustaa($r['=28M'], 5)));
        $this->mpdf->WriteText(87, 147, expandeespacios(ajustaa($r['=29M'], 5)));
        $this->mpdf->WriteText(87, 153, expandeespacios(ajustaa($r['30_4M'], 5)));
        $this->mpdf->WriteText(87, 159, expandeespacios(ajustaa($r['35_9M'], 5)));
        $this->mpdf->WriteText(87, 165, expandeespacios(ajustaa($r['>39M'], 5)));
        $this->mpdf->WriteText(87, 177, expandeespacios(ajustaa($r['TNIM'], 5)));

        $this->mpdf->WriteText(120, 75, expandeespacios(ajustaa($r['T<18'], 5)));
        $this->mpdf->WriteText(120, 81, expandeespacios(ajustaa($r['T=18'], 5)));
        $this->mpdf->WriteText(120, 87, expandeespacios(ajustaa($r['T=19'], 5)));
        $this->mpdf->WriteText(120, 93, expandeespacios(ajustaa($r['T=20'], 5)));
        $this->mpdf->WriteText(120, 99, expandeespacios(ajustaa($r['T=21'], 5)));
        $this->mpdf->WriteText(120, 105, expandeespacios(ajustaa($r['T=22'], 5)));
        $this->mpdf->WriteText(120, 111, expandeespacios(ajustaa($r['T=23'], 5)));
        $this->mpdf->WriteText(120, 117, expandeespacios(ajustaa($r['T=24'], 5)));
        $this->mpdf->WriteText(120, 123, expandeespacios(ajustaa($r['T=25'], 5)));
        $this->mpdf->WriteText(120, 129, expandeespacios(ajustaa($r['T=26'], 5)));
        $this->mpdf->WriteText(120, 135, expandeespacios(ajustaa($r['T=27'], 5)));
        $this->mpdf->WriteText(120, 141, expandeespacios(ajustaa($r['T=28'], 5)));
        $this->mpdf->WriteText(120, 147, expandeespacios(ajustaa($r['T=29'], 5)));
        $this->mpdf->WriteText(120, 153, expandeespacios(ajustaa($r['T30_4'], 5)));
        $this->mpdf->WriteText(120, 159, expandeespacios(ajustaa($r['T35_9'], 5)));
        $this->mpdf->WriteText(120, 165, expandeespacios(ajustaa($r['T+39'], 5)));
        $this->mpdf->WriteText(120, 177, expandeespacios(ajustaa($r['TNIT'], 5)));

        $r = ($this->get_permanencia());
        $this->mpdf->WriteText(163, 75, expandeespacios(ajustaa($r['<18H'], 5)));
        $this->mpdf->WriteText(163, 81, expandeespacios(ajustaa($r['=18H'], 5)));
        $this->mpdf->WriteText(163, 87, expandeespacios(ajustaa($r['=19H'], 5)));
        $this->mpdf->WriteText(163, 93, expandeespacios(ajustaa($r['=20H'], 5)));
        $this->mpdf->WriteText(163, 99, expandeespacios(ajustaa($r['=21H'], 5)));
        $this->mpdf->WriteText(163, 105, expandeespacios(ajustaa($r['=22H'], 5)));
        $this->mpdf->WriteText(163, 111, expandeespacios(ajustaa($r['=23H'], 5)));
        $this->mpdf->WriteText(163, 117, expandeespacios(ajustaa($r['=24H'], 5)));
        $this->mpdf->WriteText(163, 123, expandeespacios(ajustaa($r['=25H'], 5)));
        $this->mpdf->WriteText(163, 129, expandeespacios(ajustaa($r['=26H'], 5)));
        $this->mpdf->WriteText(163, 135, expandeespacios(ajustaa($r['=27H'], 5)));
        $this->mpdf->WriteText(163, 141, expandeespacios(ajustaa($r['=28H'], 5)));
        $this->mpdf->WriteText(163, 147, expandeespacios(ajustaa($r['=29H'], 5)));
        $this->mpdf->WriteText(163, 153, expandeespacios(ajustaa($r['30_4H'], 5)));
        $this->mpdf->WriteText(163, 159, expandeespacios(ajustaa($r['35_9H'], 5)));
        $this->mpdf->WriteText(163, 165, expandeespacios(ajustaa($r['>39H'], 5)));
        $this->mpdf->WriteText(163, 177, expandeespacios(ajustaa($r['TREH'], 5)));

        $this->mpdf->WriteText(196, 75, expandeespacios(ajustaa($r['<18M'], 5)));
        $this->mpdf->WriteText(196, 81, expandeespacios(ajustaa($r['=18M'], 5)));
        $this->mpdf->WriteText(196, 87, expandeespacios(ajustaa($r['=19M'], 5)));
        $this->mpdf->WriteText(196, 93, expandeespacios(ajustaa($r['=20M'], 5)));
        $this->mpdf->WriteText(196, 99, expandeespacios(ajustaa($r['=21M'], 5)));
        $this->mpdf->WriteText(196, 105, expandeespacios(ajustaa($r['=22N'], 5)));
        $this->mpdf->WriteText(196, 111, expandeespacios(ajustaa($r['=23M'], 5)));
        $this->mpdf->WriteText(196, 117, expandeespacios(ajustaa($r['=24M'], 5)));
        $this->mpdf->WriteText(196, 123, expandeespacios(ajustaa($r['=25M'], 5)));
        $this->mpdf->WriteText(196, 129, expandeespacios(ajustaa($r['=26M'], 5)));
        $this->mpdf->WriteText(196, 135, expandeespacios(ajustaa($r['=27M'], 5)));
        $this->mpdf->WriteText(196, 141, expandeespacios(ajustaa($r['=28M'], 5)));
        $this->mpdf->WriteText(196, 147, expandeespacios(ajustaa($r['=29M'], 5)));
        $this->mpdf->WriteText(196, 153, expandeespacios(ajustaa($r['30_4M'], 5)));
        $this->mpdf->WriteText(196, 159, expandeespacios(ajustaa($r['35_9M'], 5)));
        $this->mpdf->WriteText(196, 165, expandeespacios(ajustaa($r['>39M'], 5)));
        $this->mpdf->WriteText(196, 177, expandeespacios(ajustaa($r['TREM'], 5)));

        $this->mpdf->WriteText(229, 75, expandeespacios(ajustaa($r['T<18'], 5)));
        $this->mpdf->WriteText(229, 81, expandeespacios(ajustaa($r['T=18'], 5)));
        $this->mpdf->WriteText(229, 87, expandeespacios(ajustaa($r['T=19'], 5)));
        $this->mpdf->WriteText(229, 93, expandeespacios(ajustaa($r['T=20'], 5)));
        $this->mpdf->WriteText(229, 99, expandeespacios(ajustaa($r['T=21'], 5)));
        $this->mpdf->WriteText(229, 105, expandeespacios(ajustaa($r['T=22'], 5)));
        $this->mpdf->WriteText(229, 111, expandeespacios(ajustaa($r['T=23'], 5)));
        $this->mpdf->WriteText(229, 117, expandeespacios(ajustaa($r['T=24'], 5)));
        $this->mpdf->WriteText(229, 123, expandeespacios(ajustaa($r['T=25'], 5)));
        $this->mpdf->WriteText(229, 129, expandeespacios(ajustaa($r['T=26'], 5)));
        $this->mpdf->WriteText(229, 135, expandeespacios(ajustaa($r['T=27'], 5)));
        $this->mpdf->WriteText(229, 141, expandeespacios(ajustaa($r['T=28'], 5)));
        $this->mpdf->WriteText(229, 147, expandeespacios(ajustaa($r['T=29'], 5)));
        $this->mpdf->WriteText(229, 153, expandeespacios(ajustaa($r['T30_4'], 5)));
        $this->mpdf->WriteText(229, 159, expandeespacios(ajustaa($r['T35_9'], 5)));
        $this->mpdf->WriteText(229, 165, expandeespacios(ajustaa($r['T+39M'], 5)));
        $this->mpdf->WriteText(229, 177, expandeespacios(ajustaa($r['TRET'], 5)));


        $s = $this->claveuv;
        $this->mpdf->WriteText(17, 195, expandeespacios($s));
        $claveescuela = $FACU;
        $this->mpdf->WriteText(87, 195, expandeespacios($claveescuela));
        $clavecarrera = $CARR;
        $this->mpdf->WriteText(157, 195, expandeespacios($clavecarrera));
        $clavecarrera2 = $CARR2;
        $this->mpdf->WriteText(221, 195, expandeespacios($clavecarrera2));
    }

    function hoja13() {
        $this->mpdf->AddPage('', '', '', '', '', '', '', 0, 0, 1, '', '', '', '', '', '', '', '', '', '', 'Letter-L');
        $vista = $this->load->view('pdfviewtest', array('pagina' => sprintf("%02d", 13)), true);
        $this->mpdf->WriteHTML($vista);
        $año = ajustaa(date('Y'), 4);
        $this->mpdf->WriteText(193, 131, expandeespacios($año));
        $mes = ajustaa(date('m'), 2);
        $this->mpdf->WriteText(221, 131, expandeespacios($mes));
        $dia = ajustaa(date('d'), 2);
        $this->mpdf->WriteText(238, 131, expandeespacios($dia));
        $responsablecarrera = 'Mtra. Socorro Vicarte Palmeros';
        $this->mpdf->WriteText(30, 125, $responsablecarrera);
        $responsablellenado = 'Dr. Ragueb Chaín Revuelta';
        $this->mpdf->WriteText(35, 165, $responsablellenado);
    }*/

}

